<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="/static/js/jquery-1.11.3.js"></script>
</head>
<script>
    $(function () {
        $('#tijiao').click(function () {
            // 传递字典
        var dic = {
            "uname" : $("#uname").val(),
            "uage": $("#uage").val(),
            //"csrfmiddlewaretoken":$("[name='csrfmiddlewaretoken']").val(),
        }

        // 传递数组
            var ids = [{"1":"yangxin"},1,2,3,4]

           //ids.push(dic)
            console.log(1)
            console.log(ids)
            var dic1={
                "csrfmiddlewaretoken":$("[name='csrfmiddlewaretoken']").val(),
                "ids":JSON.stringify(ids),
            }

        $.post('/ce/',dic1,function (data) {
            //if(data.d==0){
             //   alert('没有')
            //}
            //else{
            //    alert('有')
           // }
        },'html');
    })
    })
</script>
<body>
<form>
    {% csrf_token %}
 <p>
     姓名： <input type="text" id="uname">
 </p>
<p>
    年龄： <input type="number" id="uage">
</p>
<button id="tijiao">提交</button>
</form>
</body>
</html>